list=[1,2,3,4]
it = iter(list)
print(next(it))

#迭代器遍历
list=[1,2,3,4]
it = iter(list)    # 创建迭代器对象
for x in it:
    print (x, end=" ")

print()

#上面使用next也可以
import sys         # 引入 sys 模块
 
list=[1,2,3,4]
it = iter(list)    # 创建迭代器对象
 
i=1
size=len(list)
print("i:%d" % i)
while True:
        print (next(it))
        i=i+1
        if i>size:
              break

   

list=[1,2,3,4]
it=iter(list)
print(next(it))
print(next(it))



